<%-- 
    Document   : popuptemplate
    Created on : Jun 4, 2012, 2:47:19 PM
    Author     : ems
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../css/popup.css"/> 
        <link rel="stylesheet" type="text/css" href="../css/kapiform.css"/> 
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>  
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/kapi.js"></script>


        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            $j(document).ready(function(){
              
                var b = location.pathname;
                $j("input[id$='message']").val(b);
                validateform("job");
                $j('input#leavedate1,input#leavedate2').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                $j(".abc").live("change",function(){
                    var obj1 = $j(this).children("option:selected").val();
                    if(obj1 != null)
                    {
                        $j.post("actionDebt.jsp?action=cn&id="+obj1);
                    }
                });
                //                $j('checkacc').live('click',function(){
                //                    pn100 = $j(this).val();
                //                     if( $j(this).is(":checked")){
                //                         $j.post('financialAccountInputcreate.jsp?action=searchper&pn100='+pn100,function(data){
                //                             
                //                         });              
                //                     }else{
                //                           $j.post('financialAccountInputcreate.jsp?action=unsearchper&pn100=0',function(data){
                //                             
                //                         });  
                //                     }
                //                });
            });
        </script>
        <style type="text/css">
            .ui-datepicker-trigger{
                margin-top: 2px !important;
            }
            #ui-datepicker-div
            {
                z-index: 9999999;
            }
            .number{
                text-align: right;
            }
            .stardates{
                float:left;
                width:281px;
                margin-left:11px;
            }
            .stardates label{
                float:left;
                width:92px;
                text-align: right;
                margin-top:4px;
            }
            .stardates input[type="text"] {
                width:100px ;
                float:left;
                margin-left: 4px;
                margin-right: 4px;
            }
            .enddates input[type="text"] {
                width:100px;
                float:left;
                margin-left:0px;
                margin-right: 4px;
            }
            .enddates label{
                float:left;
                width:110px;
                text-align: right;
                margin-top:4px;
                margin-right: 4px;
            }
            .enddates{
                float:left;
            }
            .bg_job_left_right{
                background: #fff;
            }
            .field_blue{
                background: #fff !important;
            }
            .fields_input label{
                width: 105px !important;
            }
            .addjob_left_right{
                width:690px !important;
            }
        </style>

    </head>


    <body style=" float:left; width:auto; height:auto; margin:0px;">
        <f:view>
            <a4j:status onstart="#{rich:component('statPane')}.show()" onstop="#{rich:component('statPane')}.hide()" />
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <a4j:form id="job" >
                <div class="popup" style="height:600px; width:660px">
                    <div class="popup-header">
                        <div class="title"><h:outputText value="TẠO PHIẾU THU CHI"/></div>
                    </div>
                    <div class="popup-content" style="height: auto !important;">
                        <div class="main_content">
                            <div class="form_item_content labe_short" style="display: block;margin-top: 3px;margin-left: 0;">
                                <div style="float:left;width:100%;">
                                    <div style="float:left;width: 60%;">
                                        <div style="float:left;width: 68%;">
                                            <label style="float:left;width: 100px;text-align: right;margin-right: 3px;"><h:outputText value="Loại phiếu"/>* :</label>
                                            <h:selectOneMenu style="height:25px;width:166px;" value="#{T950Bean.ft000}"  >  
                                                <f:selectItems value="#{T950Bean.listCombT100}" />  

                                            </h:selectOneMenu> 
                                        </div>
                                        <div style="float:left;width: 20%;">
                                            <h:selectOneMenu value="#{T950Bean.tv952}"  style="width:70px;margin-left:5px;float:left;">  
                                                <f:selectItem itemValue="1" itemLabel="VND" />  
                                                <f:selectItem itemValue="2" itemLabel="USD" />   
                                                <f:selectItem itemValue="3" itemLabel="EUR" />   
                                            </h:selectOneMenu>
                                        </div>
                                    </div>
                                    <div style="float:left;width:40%;">
                                        <label style="float:left;width: 43px;text-align: right;margin-right: 3px;"><h:outputText value="Tỷ giá"/>* :</label>
                                        <h:inputText value="" style="margin-left:0;" />

                                    </div>
                                </div>
                                <div class="job_left_right addjob_left_right bg_job_left_right">
                                    <div class="job_left" style="width:340px">                        
                                        <div class="fields_input">
                                            <label><h:outputText value="Mục đích"/> :</label>
                                            <h:selectOneMenu value="#{T950Bean.pt075}"  >  
                                                <f:selectItems value="#{T950Bean.listCombT075}" />  

                                            </h:selectOneMenu> 
                                        </div>

                                    </div>
                                    <div class="job_right">
                                        <div class="fields_input" >
                                            <label><h:outputText value="Tài khoản"/>* :</label>
                                            <h:selectOneMenu value="#{T950Bean.fh075}">  
                                                <f:selectItems value="#{T950Bean.listCombH075}" />  

                                            </h:selectOneMenu>

                                        </div> 
                                    </div>
                                </div>
                                <div class="job_left_right addjob_left_right" style="width:690px;background-color: #C9D7E5;">
                                    <!-- start job_left-->
                                    <div class="job_left" style="width:340px">
                                        <div class="fields_input">                                            
                                            <label><h:outputText value="Code tour"/>:</label>
                                            <h:selectOneMenu id="codeTour" value="#{T950Bean.pv050}" styleClass="fv050">
                                                <f:selectItems value="#{T950Bean.listCombB050}"  />   
                                           <%--     <a4j:support event="onchange"   reRender="tour" actionListener="#{TourBean.actionListenner}"/>--%>
                                            </h:selectOneMenu>
                                        </div>                                

                                    </div>
                                    <div class="job_right">

                                        <div class="fields_input" >
                                            <label><h:outputText value="Phân loại"/>* :</label>
                                            <h:selectOneMenu value="#{T950Bean.typecus}">  
                                                <%--                                                <f:selectItems value="#{T950Bean.listCombN100}" />  --%>
                                                <f:selectItem itemLabel="---SELECT----" itemValue="0"/>
                                                <f:selectItem itemLabel="Nhân viên" itemValue="1"/>
                                                <f:selectItem itemLabel="Khách hàng" itemValue="2"/>
                                                <a4j:support event="onchange" actionListener="#{T950Bean.onchangepersonalSystem}" reRender="formsearch,sear,sear1"/>
                                            </h:selectOneMenu>

                                        </div>

                                    </div>
                                </div>
                                <h:panelGroup id="formsearch">

                                    <div class="job_left_right addjob_left_right" style="width:690px;background-color: #C9D7E5;display: <h:outputText value="#{T950Bean.block}"/>">
                                        <div class="job_left">
                                            <div class="fields_input" >
                                                <label><h:outputText value="Người nộp/nhận"/>* :</label>
                                              <h:selectOneMenu value="#{T950Bean.pn100t}">  
                                                    <f:selectItems value="#{T950Bean.listCombN100}" />  
                                                    <a4j:support event="onchange" actionListener="#{T950Bean.onchangepersonalSystemcombo}" reRender="sear1"/>
                                                </h:selectOneMenu>
                                            </div>
                                        </div>

                                    </div>
                                    <div style="float:left;width:100%;height: 200px;display: <h:outputText value="#{T950Bean.none}"/>">
                                        <div style="float:right;width:100%;">

                                            <h:inputText value="#{T950Bean.keysearch}" onfocus="if(this.value=='Key search') this.value='';" style="float:right;height:25px;width:166px;"/>
                                            <a4j:commandButton actionListener="#{T950Bean.searchpersonalSystem}" reRender="sear" value="Search" style="float:right;"/>
                                        </div>
                                        <h:panelGroup id="sear">
                                            <div style="float:right;width:100%;height: 180px;overflow: auto;">
                                                <rich:dataTable value="#{T950Bean.listresultpersonal}" var="item" rowKeyVar="row" rowClasses="">
                                                    <rich:column width="10%">
                                                        <f:facet name="header">
                                                            <h:outputText value="Select"/>
                                                        </f:facet>
                                                        <div style="width:100%;text-align: center;">
                                                        <%--    <h:selectBooleanCheckbox valueChangeListener="#{T950Bean.onclickpersonalSystem}" value="#{T950Bean.flagcus}"  styleClass="checkacc" lang="#{item.pn100}">
                                                               
                                                                
                                                            </h:selectBooleanCheckbox> --%>
                                                        <a4j:commandButton  reRender="sear1" value="check" actionListener="#{T950Bean.onclickpersonalSystem}">
                                                            <f:param value="#{item.pn100}" name="pn100"/>
                                                        </a4j:commandButton>
                                                         
                                                        </div>
                                                    </rich:column>
                                                    <rich:column width="50%">
                                                        <f:facet name="header">
                                                            <h:outputText value="Full name"/>
                                                        </f:facet>
                                                        <div style="width:100%;text-align: left;">
                                                            <h:outputText value="#{item.hoten}"/>
                                                        </div>
                                                    </rich:column>
                                                    <rich:column width="40%">
                                                        <f:facet name="header">
                                                            <h:outputText value="Address"/>
                                                        </f:facet>
                                                        <div style="width:100%;text-align: left;">
                                                            <h:outputText value="#{item.nv112}"/>
                                                        </div>
                                                    </rich:column>
                                                </rich:dataTable>

                                            </div>
                                        </h:panelGroup>
                                    </div>
                                </h:panelGroup>
                                <h:panelGroup id="sear1">
                                    <div style="float:left;width:100%;background-color: #C9D7E5;display: <h:outputText value="#{T950Bean.block1}"/>">
                                        <div style="float:left;width:100%;height: 25px;">
                                            <label style="float:left;width: 100px;text-align: right;margin-right: 3px;"><h:outputText value="Họ tên"/> :</label>
                                            <h:outputText value="#{T950Bean.hoten}" style="margin-left:0;font-weight:bold;color:blue;" />
                                        </div>
                                        <div style="float:left;width:100%;height: 25px;">
                                            <label style="float:left;width: 100px;text-align: right;margin-right: 3px;"><h:outputText value="Địa chỉ"/> :</label>
                                            <h:outputText value="#{T950Bean.adddress}" style="margin-left:0;font-weight:bold;color:blue;" />
                                        </div>
                                    </div>
                                </h:panelGroup>

                                <div class="job_left_right addjob_left_right" style="width:690px;">
                                    <div class="job_left" style="width:340px">

                                        <div class="fields_input">
                                            <label class="longlabel">Số tiền:</label>
                                            <h:inputText value="#{T950Bean.tn951St}" styleClass="numberright" />
                                        </div>
                                        <div class="fields_input">
                                            <label>Số hóa đơn:</label>
                                            <h:inputText value="#{T950Bean.tv969}" styleClass="" />
                                        </div>
                                        <%--                                        <div class="fields_input">
                                                                                    <label>Số seri:</label>
                                                                                    <h:inputText value="#{T950Bean.tv970}" styleClass="" />
                                                                                </div>--%>

                                    </div>
                                    <div class="job_right">

                                        <div class="fields_input ">
                                            <label>Ngày nhập HD:</label>

                                            <input value="<h:outputText value="#{T950Bean.td953}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>" type="text" id="leavedate1" name="leavedate1" class="required Date" />

                                        </div>
                                        <div class="fields_input">
                                            <label>Ngày hiệu lực:</label>


                                            <input value="<h:outputText value="#{T950Bean.td954}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>" type="text" id="leavedate2" name="leavedate2" class="required Date" />
                                        </div>
                                        <%--                                        <div class="fields_input job_feild_input">
                                                                                    <label> Nội bộ:</label>
                                                                                    <h:inputText value="#{T950Bean.tv957}" styleClass="" />
                                                                                </div>
                                                                                <div class="fields_input ">
                                                                                    <label class="longlabel">Bên ngoài:</label>
                                                                                    <h:inputText value="#{T950Bean.tv958}" styleClass="" />
                                                                                </div>--%>
                                    </div>
                                </div>
                                <div class="group_feild bg_job_left_right addjob_left_right">

                                    <div class="field_blue">
                                        <div class="fields_input  ">
                                            <label>Ghi chú:</label>
                                            <h:inputTextarea value="#{T950Bean.tv971}" style="width:506px;" />
                                        </div>
                                    </div>
                                </div>
                                <div class="alert" style="margin-top:0px;">

                                </div>
                            </div>

                        </div>

                    </div>
                    <div class="popup-footer">

                        <div class="buttonsave" onclick="jQuery.fancybox.close() "  ><span><h:outputText value="#{locale.close}"/></span></div>
                        <h:commandButton onclick="return validatecheck('job');" action="#{T950Bean.updateTn950}"  value="#{locale.save}" styleClass="buttonsave">

                        </h:commandButton>
                        <h:inputHidden value="#{T950Bean.pt950}" id="pt950"/>
                        <h:inputHidden value="#{T950Bean.papeload}" id="page"/>
                        <h:inputHidden value="#{T950Bean.different}" id="different"/>



                    </div>
                </div>
                <rich:modalPanel styleClass="pleaseimage" id="statPane" autosized="true" minHeight="10" minWidth="80"
                                 height="10" width="80" zindex="2000">
                    <h:graphicImage value="/images/loadingAnimation.gif" alt="ai" />
                </rich:modalPanel>
            </a4j:form>
        </f:view>
    </body>
</html>
<script type="text/javascript">
    $j(document).ready(function(){
        yhight = ($j('.popup').height()-90)+"px" ;
        $j('.main_content').css('height',yhight );
        $j('.popup-content').css('height',510 );
    });
</script>